#include <opencv2/opencv.hpp>
#include <iostream>

int main(int argc, char ** argv){
    cv::Mat frame;
    if(argc != 2){
        std::cout << "Usage: <cmd> <video_path>" << std::endl;
    }
    cv::VideoCapture vid(argv[1]);
    if(vid.isOpened() == false){
        std::cout << "Can't read the file" << std::endl;
        return -1;
    }
    int fps = (int)vid.get(CV_CAP_PROP_FPS);
    while(1){
        if(vid.read(frame) == false){
            break;
        }
        cv::imshow(argv[1], frame);
        if(cv::waitKey(1000/fps) > 0) break;
    }
    return 0;
}
